<template>
  <div class="home">
    <CustomHead />
    <div class="row">
      <div class="user">
        <div class="avatar">
          <img src="../assets/avatar.png" alt="">
          <span>学生</span>
        </div>
        <p>莱恩思</p>
        <p>电子信息工程学院</p>
        <div class="bottom">
          <div>
            <img src="../assets/my-icon.png" alt="">个人中心
          </div>
          <span class="line">|</span>
          <div>
            <img src="../assets/email-icon.png" alt="">邮箱中心
          </div>
        </div>
        <img class="user-bg" src="../assets/user-bg.png" alt="">
      </div>
      <div class="course">
        <div class="title">
          <!-- <span class="active">我的课表</span> -->
          <span>我的课表</span>
        </div>
        <div></div>
      </div>
      <div class="task box">
        <div class="head">
          <div class="title">任务中心</div>
          <div class="tabs">
            <span @click="onChangeTaskTab(index)" :class="taskTabIndex == index ? 'active' : ''"
              v-for="(tab, index) in taskTabs" :key="index">{{ tab }}</span>
          </div>
          <div class="more">更多>></div>
        </div>
        <el-table :data="taskTableData" style="width: 100%">
          <el-table-column prop="title" label="事项名称" width="300">
          </el-table-column>
          <el-table-column prop="name" label="发起人" width="180">
          </el-table-column>
          <el-table-column prop="date" label="时间" width="250">
          </el-table-column>
          <el-table-column label="状态">
            <template slot-scope="scope">
              <span style="color: #FEC006;">请处理</span>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="application box">
        <div class="title">我的应用</div>
        <div class="grid">
          <div class="grid-info">
            <div class="item">
              <img src="../assets/email.png" alt="">
              <span>内部邮件</span>
            </div>
          </div>
          <div class="grid-info">
            <div class="item">
              <img src="../assets/edu-admin-icon.png" alt="">
              <span>教务管理系统</span>
            </div>
          </div>
          <div class="grid-info">
            <div class="item">
              <img src="../assets/task.png" alt="">
              <span>任务中心</span>
            </div>
          </div>
          <div class="grid-info">
            <div class="item">
              <img src="../assets/caiwu.png" alt="">
              <span>财务系统</span>
            </div>
          </div>
          <div class="grid-info">
            <div class="item">
              <img src="../assets/shixun.png" alt="">
              <span> 全员实训管理系统</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import CustomHead from '../components/CustomHead.vue';
export default {
  name: 'StudentHomeView',
  components: {
    CustomHead,
  },
  data() {
    return {
      taskTabs: ["待办任务", "已办任务", "我发起的"],
      taskTabIndex: 0,
      taskTableData: [{
        date: '2016-05-02',
        name: '覃宝珍',
        title: '关于《信息技术应用软件供应链安全开源组 件检测要求》团队标准参编的请示'
      }, {
        date: '2024-06-24 12:59:15',
        name: '蒋文胜',
        title: '关于《信息技术应用软件供应链安全开源组 件检测要求》团队标准参编的请示'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        title: '人才培育方案异动申请表流程'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        title: '外出申请登记'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        title: '人才培育方案异动申请表流程'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        title: '外出申请登记'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        title: '人才培育方案异动申请表流程'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        title: '外出申请登记'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        title: '人才培育方案异动申请表流程'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        title: '外出申请登记'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        title: '人才培育方案异动申请表流程'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        title: '外出申请登记'
      }]
    }
  },
  mounted() {
  },
  methods: {
    onChangeTaskTab(index) {
      this.taskTabIndex = index;
    }
  }
}
</script>

<style scoped lang="scss">
::-webkit-scrollbar {
  display: none;
}

.home {
  background-color: #F1F3F5;
  min-height: 100vh;

  .row {
    display: flex;
    flex-wrap: wrap;
    margin: 20px 100px;

    .box {
      box-sizing: border-box;

      .title {
        text-align: left;
        height: 50px;
        line-height: 50px;
        font-weight: bold;
        color: #202020;
        font-size: 20px;
      }
    }

    .user {
      position: relative;
      background-color: #0D67BB;
      width: 16%;
      color: white;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 20px 0 50px;
      box-sizing: border-box;
      margin: 0 1% 0 0;
      overflow: hidden;

      .avatar {
        position: relative;
        width: 100px;
        height: 100px;
        border-radius: 50%;
        overflow: hidden;
        margin-bottom: 15px;

        span {
          position: absolute;
          bottom: 0px;
          left: 50%;
          transform: translateX(-50%);
          background-color: rgba(0, 0, 0, 0.5);
          background-color: rgba($color: #0D67BB, $alpha: 0.3);
          color: #fff;
          padding: 2px 10px;
          border-radius: 15px;
          font-size: 12px;
          white-space: nowrap;
          width: 100%;
          height: 28%;
          text-align: center;
          padding-top: 10px;
        }

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
        }
      }

      p {
        margin-bottom: 15px;
      }

      .bottom {
        display: flex;
        margin-top: 35px;

        &>div {
          display: flex;
          align-items: center;
          font-size: 13px;

          &:first-child {
            margin-right: 5px;
          }

          &:last-child {
            margin-left: 5px;
          }

          img {
            width: 16px;
            margin-right: 5px;
          }
        }

        .line {
          font-size: 11px;
          display: flex;
          align-items: center;
          margin: 0 8px;
        }
      }

      .user-bg {
        position: absolute;
        bottom: -65px;
        left: -71px;
        right: 0;
        width: 115%;
      }
    }

    .notic {
      box-shadow: 0 0 10px rgba(240, 238, 238, 0.5);
      margin: 0 1% 0 0;
      overflow: hidden;
      width: 40%;
      height: 380px;
      padding-bottom: 25px;

      .title {
        text-align: left;
        padding-left: 15px;
        height: 50px;
        line-height: 50px;
        font-weight: bold;
        color: #202020;
        font-size: 20px;
        display: flex;
        background-color: white;

        span:first-child {
          flex: 1;
        }

        span:last-child {
          width: 60px;
          font-weight: normal;
          font-size: 14px;
          color: #aca8a8;
        }
      }

      .notic-content {
        font-size: 14px;
        display: flex;
        height: 355px;

        .dot {
          display: inline-block;
          width: 5px;
          height: 5px;
          background-color: red;
          border-radius: 50%;
          margin-left: 8px;
          vertical-align: middle;
        }

        &>.left {
          display: flex;
          flex-direction: column;
          width: 100px;
          background-color: #F7F8FC;
          flex-shrink: 0;
          height: 100%;

          &>p {
            display: flex;
            align-items: center;
            padding: 15px 0;
            padding-left: 10px;

            &.active {
              background-color: #B6DAF9;
            }


          }
        }

        &>.list {
          background-color: white;
          padding: 0 8px 0;
          overflow: auto;
          flex: 1;

          .item {
            display: flex;
            border-bottom: 1px dashed #ebebeb;
            height: 37px;
            line-height: 30px;

            span:first-child {
              flex: 1;
              white-space: nowrap;
              text-overflow: ellipsis;
              overflow: hidden;
              font-size: 14px;
              color: #555555;
            }

            span:last-child {
              font-size: 14px;
              color: #999999;
            }
          }
        }
      }
    }

    .schedule {
      background-color: rgba($color: #ffffff, $alpha: 1);
      box-shadow: 0 0 10px rgba(240, 238, 238, 0.5);
      width: 42%;
      padding: 0 10px 25px;
      overflow: hidden;
      height: 380px;

      .title {
        text-align: left;
        margin-left: 15px;
        height: 50px;
        line-height: 50px;
        font-weight: bold;
        color: #202020;
        font-size: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;

        span:last-child {
          font-size: 14px;
          color: #E53E3E;
          margin-right: 8px;
        }
      }

      .bottom {
        display: flex;
        margin-top: 10px;

        .left {
          flex: 1.2;

          .vc-container {
            border: 0;
            width: 100%;

            :deep .vc-dot {
              width: 10px;
              height: 10px;
            }
          }
        }

        .right {
          flex: 1;
          display: flex;
          flex-direction: column;

          .list {
            margin-top: 35px;
            margin-left: 10px;
            min-height: 200px;
            max-height: 235px;
            overflow: auto;

            .item {
              display: flex;
              align-items: center;
              font-size: 14px;
              margin-bottom: 15px;

              .dot {
                width: 12px;
                height: 12px;
                border-radius: 50%;

                &.finished {
                  background-color: rgba($color: #333333, $alpha: 0.3);
                }

                &.active {
                  background-color: #FF0000;
                }

                &.undo {
                  background-color: white;
                  border: 1px solid #0D67BB;
                }
              }

              .time {
                margin: 0 10px;
                width: 40px;
              }

              .txt {
                flex: 1;
              }
            }
          }

          .add-btn {
            background-color: #0D67BB;
            border-radius: 0;
            width: 80px;
            align-self: center;
            margin-top: 8px;
          }
        }

      }
    }

    .course {
      width: 83%;
      box-shadow: 0 0 10px rgba(240, 238, 238, 0.5);
      background-color: white;
      height: 380px;
      padding-right: 15px;
      overflow: hidden;
      box-sizing: border-box;
      .title {
        padding: 15px;
        text-align: left;
        padding-left: 15px;
        height: 50px;
        font-weight: bold;
        color: #202020;
        font-size: 20px;

        span:first-child {
          margin-right: 15px;

          &.active {
            color: #FA9E00;
            padding-bottom: 2px;
            font-weight: bold;
            border-bottom: 2px solid #FA9E00;
          }
        }
      }
    }

    .task {
      width: 57%;
      box-shadow: 0 0 10px rgba(240, 238, 238, 0.5);
      background-color: white;
      height: 380px;
      padding-right: 15px;
      overflow: hidden;
      margin: 20px 1% 20px 0;

      .head {
        display: flex;
        align-items: center;

        .title {
          text-align: left;
          padding-left: 15px;
          height: 50px;
          line-height: 50px;
          font-weight: bold;
          color: #202020;
          font-size: 20px;
          display: flex;
          background-color: white;

          span:first-child {
            flex: 1;
          }

          span:last-child {
            width: 60px;
            font-weight: normal;
            font-size: 14px;
            color: #aca8a8;
          }
        }

        .tabs {
          margin-left: 15px;
          border-left: 2px solid #0D67BB;
          padding-left: 15px;
          font-size: 18px;
          flex: 1;

          span {
            margin-right: 20px;
            color: rgba($color: #333333, $alpha: 0.6);

            &.active {
              color: #FA9E00;
              padding-bottom: 2px;
              font-weight: bold;
              border-bottom: 2px solid #FA9E00;
            }
          }
        }

        .more {
          color: rgba($color: #202020, $alpha: 0.4);
          font-size: 14px;
        }
      }

      .el-table {
        margin: 0 15px;

        :deep .is-leaf,
        :deep td.el-table__cell {
          text-align: center;
        }

        :deep .el-table_1_column_1 {
          &>div {
            // white-space: nowrap;
            // text-overflow: ellipsis;
            // overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            /* 限制显示的行数 */
            overflow: hidden;
            /* 隐藏溢出部分 */
            text-overflow: ellipsis;
            /* 用省略号表示被截断的文本 */
            white-space: normal;
            /* 正常换行 */
          }
        }

        :deep th.el-table__cell .cell {
          color: rgba($color: #333333, $alpha: 0.5)
        }
      }

    }

    .application {
      background-color: white;
      box-shadow: 0 0 10px rgba(240, 238, 238, 0.5);
      width: 42%;
      padding: 0 10px 0;
      overflow: hidden;
      height: 380px;
      margin-top: 20px;
      box-sizing: border-box;

      .title {
        text-align: left;
        margin-left: 15px;
        height: 60px;
        line-height: 60px;
        font-weight: bold;
        color: #202020;
        font-size: 18px;
        margin-bottom: 10px;
      }

      .grid {
        display: flex;
        flex-wrap: wrap;

        .grid-info {
          width: 20%;
          margin-bottom: 30px;
          padding: 0 5px;
          box-sizing: border-box;

          .item {
            display: flex;
            justify-content: center;
            flex-direction: column;
            align-items: center;
            text-align: center;

            img {
              width: 40px;
              height: 40px;
              color: #4881EF;
              margin-bottom: 8px;
            }

            span {
              margin-top: 8px;
            }
          }
        }
      }
    }
  }
}
</style>
